<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
#result p {
 font-size: 18px;
}
</style>
<script type="text/javascript" src="/static/jquery.min.js"></script>
<script type="text/javascript">
var isDo = false;
function doRequest() {
	if (!isDo) {
		isDo = true;
		var count = 0;
		var uri = $("#uri").val();
		setInterval(function(){
			$.ajax({
				url: uri, 
				dataType: "text", 
				success: function(result) {
					count++;
			    	$("#result").prepend("<p>[" + count + "]调用返回>>>" + result + "</p>");
			    	if($("#result p").length > 15){
			    		$("#result p").last().remove();
			    	}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					count++;
					$("#result").prepend("<p>[" + count + "]" + textStatus + "</p>");
				}
			});			
		}, 1000);
	}
}
</script>
</head>
<body>
<input id="uri" type="text" size="100"/>
<button onclick="doRequest()">开始运行</button>
<div id="result"></div>
</body>
</html>